package com.producteev4j.model.json.activity;

import com.producteev4j.model.request.ProducteevDateUtil;
import com.producteev4j.model.response.Activity;
import com.producteev4j.model.response.BaseResponse;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;

import java.text.ParseException;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * User: jcarrey
 * Date: 2/07/11
 * Time: 10:39
 * To change this template use File | Settings | File Templates.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ActivityImpl extends BaseResponse implements Activity {

    @JsonProperty("id_activity")
    private long idActivity;

    private int type;

    @JsonProperty("id_task")
    private long idTask;

    @JsonProperty("id_creator")
    private long idCreator;


    private String message;

    private Date timeCreate;

    @JsonProperty("time_create")
    public void setTimeCreateString(String stringTime) {
        try {
            timeCreate = (Date) ProducteevDateUtil.parseDateRFC(stringTime).clone();
        } catch (ParseException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
    }

    public long getIdActivity() {
        return idActivity;
    }

    public void setIdActivity(long idActivity) {
        this.idActivity = idActivity;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public long getIdTask() {
        return idTask;
    }

    public void setIdTask(long idTask) {
        this.idTask = idTask;
    }

    public long getIdCreator() {
        return idCreator;
    }

    public void setIdCreator(long idCreator) {
        this.idCreator = idCreator;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Date getTimeCreate() {
        return timeCreate;
    }
}
